<?php if (! defined ( 'BASEPATH' )) 	exit ( 'No direct script access allowed' );
class Links_model extends MY_Model{
	/**
	 *	构造函数
	 */
	public function __construct(){
		parent::__construct('dili_u_m_links');
	}
	
	public function getLinks($categoryId=0){
		$maxNums=22;
		$where=($categoryId==0)?'1=1':'a.links_category='.$categoryId;
		$sql="SELECT b.category_name,a.link_name,a.link_url FROM dili_u_m_links as a join dili_u_c_links_category as b on a.links_category=b.classid where {$where}  limit 0,{$maxNums};";
		$arr=$this->db->query($sql)->result_array();
		return $arr;
	}
}
